<?xml version='1.0' encoding='UTF-8' ?> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:t="http://myfaces.apache.org/tomahawk">
    <body>
        <ui:composition template="/MenuTemplate.xhtml">
            <ui:define name="title">
                #{msg.title_itsc}
            </ui:define>
            <ui:define name="content">
                <h:panelGrid columns="1" styleClass="body_nav" >
                    <h:outputLabel styleClass="body_nav_text" value="#{msg.content_nav_usermanage}"></h:outputLabel>
                </h:panelGrid>
                <h:panelGrid  styleClass="body_content_box" columns="1">
                    <h:form>
                        <h:panelGrid styleClass="search_border" columns="1" cellpadding="0" cellspacing="0">
                            <h:panelGrid styleClass="search_title" columns="1" cellpadding="0"
                                         cellspacing="2">
                                <h:outputLabel value="#{msg.content_title_user_search}"  style="vertical-align: middle"/>
                            </h:panelGrid>
                            <h:panelGrid columns="3">
                                <h:panelGrid columns="3" cellpadding="0" border="0" cellspacing="0">
                                    <h:outputLabel value="#{msg.label_user_name}"></h:outputLabel>
                                    <h:inputText id="username" value="#{userListBean.userName}"></h:inputText>
                                    <h:outputLabel/>
                                </h:panelGrid>
                                <h:panelGrid columns="3" cellpadding="0" border="0" cellspacing="0">
                                    <h:outputLabel value="#{msg.label_user_role}"></h:outputLabel>
                                    <h:selectOneMenu id="roles" value="#{userListBean.roleId}">
                                        <f:selectItems value="#{userListBean.roleList}"/>
                                    </h:selectOneMenu>
                                    <h:outputLabel/>
                                </h:panelGrid>
                                <h:panelGrid cellspacing="0" cellpadding="0" columns="2">
                                    <h:commandButton value="#{msg.bt_search}" action="#{userListBean.refreshData}"/>
                                    <h:commandButton value="#{msg.bt_add}" action="#{userListBean.toAddUser}"/>
                                </h:panelGrid>
                            </h:panelGrid>
                        </h:panelGrid>
                    </h:form>
                </h:panelGrid>
                <h:messages globalOnly="true"
                            infoClass="info"  errorClass="alert"
                            fatalClass="colorOrange" />
                <t:aliasBean alias="#{listBean}" value="#{userListBean}">
                    <f:subview id="subview">
                        <ui:include src="./table_list.xhtml"></ui:include>
                    </f:subview>
                </t:aliasBean>
            </ui:define>
        </ui:composition>
    </body>
</html>